aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-26 13:08:08 -0800
committerAdam Soltys <[email protected]>2024-11-26 13:20:53 -0800
commit0bf630c39fe290ea2718eab7a0759d978c736ef9 (patch)
treea670c3ae954d5075c851126c2aca7a1a45d1b41d /src/routes/(app)/[username]
parent41ee0027e1767e4d116330bdee2e0456fd45f940 (diff)
downloadcoinos-ui-0bf630c39fe290ea2718eab7a0759d978c736ef9.tar.gz
coinos-ui-0bf630c39fe290ea2718eab7a0759d978c736ef9.zip
bip21 and socket fixes
Diffstat (limited to 'src/routes/(app)/[username]')
-rw-r--r--src/routes/(app)/[username]/+layout.server.ts2
-rw-r--r--src/routes/(app)/[username]/receive/+page.svelte20
2 files changed, 12 insertions, 10 deletions
diff --git a/src/routes/(app)/[username]/+layout.server.ts b/src/routes/(app)/[username]/+layout.server.ts
index 1dd163e9..bff8848c 100644
--- a/src/routes/(app)/[username]/+layout.server.ts
+++ b/src/routes/(app)/[username]/+layout.server.ts
@@ -15,7 +15,7 @@ export const load = async ({
const expires = new Date();
expires.setSeconds(expires.getSeconds() + 380 * 24 * 60 * 60);
- cookies.set("username", username, { path: "/", expires });
+ cookies.set("username", username, { path: "/", expires, httpOnly: false });
return { subject, user };
} catch (e) {
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte
index ddb17e71..89f3a1f3 100644
--- a/src/routes/(app)/[username]/receive/+page.svelte
+++ b/src/routes/(app)/[username]/receive/+page.svelte
@@ -38,16 +38,18 @@
tip;
let setType = async (type) => {
- invoice.type = type;
- ({ id } = await post(`/invoice`, {
- invoice,
- user: { username, currency },
- }));
+ $showQr = true;
+ if (type === types.lightning && !amount)
+ goto(`/${username}/receive`, { invalidateAll: true, noScroll: true });
+ else {
+ invoice.type = type;
+ ({ id } = await post(`/invoice`, {
+ invoice,
+ user: { username, currency },
+ }));
- goto(`/invoice/${id}?options=true`, {
- invalidateAll: true,
- noScroll: true,
- });
+ goto(`/invoice/${id}?options=true`, { invalidateAll: true, noScroll: true });
+ }
};
let setAmount = async (e) => {